home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gnumake / pdmake.zoo / pdmake.doc < prev    next >
Text File  |  1991-09-25  |  9KB  |  234 lines

  1.     A full featured Public Domain Make for the Atari STs.
  2.  
  3.     Adapted from mod.sources posting (Volume 7, Issue 71, 1986-12-03)
  4.     by Neil Russell and from Jwahar Bammi's port of Neil Russell's
  5.     original net.sources posting.
  6.     Thanks to both of them, they did most of the work and should
  7.     get all the credit they deserve.
  8.  
  9.     This is not a manual how to use make. For that please refer to any
  10.     UNIX manual, and/or look at the sources and example makefile.
  11.  
  12.     First Neil Russell's read.me from the mod.sources posting.
  13.     ---------------------------------------------------------------------------
  14.     Following is a repost of the public domain 'make' that I posted
  15.     to net.sources a couple of months ago.  I have fixed a few bugs, and
  16.     added some more features, and the resulting changes amounted to
  17.     about as much text as the whole program (hence the repost).
  18.     
  19.     For those that missed the net.sources posting, this is a public domain
  20.     re-implementation of the UNIX make program.  There is no manual included;
  21.     for documentation, refer to a UNIX manual, or the source.
  22.  
  23.     Here is a list of the changes made:
  24.  
  25.     i)    If '-' (ignore) or '@' (silent) where used at the start
  26.         of a command, their effect was not turned off for the following
  27.         commands.
  28.     ii)   A special target (.SUFFIXES, .PRECIOUS) or a rule (.c.o, .a.o),
  29.         if first in the file would be taken as the default target.
  30.         This resulted in error messages like "Don't know how to
  31.         make .c", because things like .SUFFIXES were being made.
  32.         This was further complicated by ---
  33.     iii)  Special target lines with no dependents (ie. .SUFFIXES:\n)
  34.         were not clearing out the existing dependents like
  35.         they should.
  36.     iv)   Default rules could not be redefined because of the error
  37.         checking for commands being defined twice.  Now you are
  38.         allowed to define a target beinging with '.', having
  39.         no dependents with commands.
  40.     v)    The -q option didn't do the time comparison correctly,
  41.         or clear the variable used to keep track of this.  Thus
  42.         it didn't work very well.
  43.     vi)   The syntax ${..} for macro's supported by UNIX make was
  44.         not supported.
  45.     vii)  There wuz a couple of spelling errors.
  46.     viii) When make checked for implicit rules on targets without
  47.         a suffix, there were problems.  (Note: The ~ feature of
  48.         UNIX make wasn't and still isn't supported)
  49.     ix)   The -n option did not print @ lines like it was supposed to.
  50.     x)    :: added.  (See UNIX manual)
  51.     xi)   $? added.  (see UNIX manual)
  52.     ---------------------------------------------------------------------------
  53. Sources:
  54.  
  55.     astat.h        h.h            main.c        rules.c
  56.     check.c        gemstart.s     input.c       make.c
  57.     ststuff.c      decl.h         macro.c       reader.c
  58.     touch.c
  59.  
  60. Alcyon C compile scripts (you only need these the first time around!):
  61.     compile.sh
  62.     link.sh
  63.     lnk
  64.  
  65. Makefile for make and touch:
  66.     makefile  - Alcyon C flavor
  67.  
  68. Touch:
  69.     compiling & linking touch.c will result in a touch program. Touch
  70.     updates the mod. time of a file to present.
  71.     Usage: touch file file ......
  72.  
  73.     #define the symbol MEGAMAX at the top of touch.c is you are
  74.     going to compile touch using the Megamax C compiler.
  75.     (Not tested by me)
  76.  
  77. Atari ST Specific Information:
  78.  
  79.     ATARI SPECIAL MACROS:
  80.  
  81.     Since the Atari ST does not have any standard shell, Jwahar built in
  82.     three macros that are useful:
  83.  
  84.     $(RM)   - removes one or more files, wild cards allowed
  85.     $(CP)   - copies one file to another. NO directories allowed,
  86.               will only accept two arguments, both of which
  87.               must be files. If the destination file exists, it
  88.               will be overwritten.
  89.     $(ECHO) - echo's its arguments.
  90.  
  91.     All Atari special commands internally begin with the character '%'
  92.     and are handled by routines in ststuff.c. It should be trivial to
  93.     add other Atari Special commands if you so desire. All other
  94.     commands are executed using the Pexec gemdos command, so complete
  95.     path names must be used.
  96.  
  97.     CONTINUATION LINES:
  98.  
  99.     The line continuation character is '\'. Back slashes may appear in
  100.     pathname, but NOT at the end of a line, as it will be taken as a
  101.     continuation backslash, and not as a part of the pathname. This should
  102.     not create any big problem as far as i can see.
  103.  
  104.  
  105.     DEFAULT RULES:
  106.  
  107.     See the file RULES.C. Jwahar built in default rules for '.c.o'
  108.     for both Alcyon C and Megamax C. But since both use the same '.o' suffix,
  109.     only one may be built into the version of make that you compile. Which
  110.     version gets built into make depends on the preprocessor symbol
  111.     'MEGRULES'. If this symbol is defined (see H.H) then Megamax rules get
  112.     built in. If it is not, then Alcyon rules get built in. All the rules
  113.     are based on values of macros defined in RULES.C. These macros may be
  114.     redefined in a makefile, and when the default rule is expanded by make
  115.     at runtime, the new redefined values will be used instead.
  116.  
  117.     Default rules may be redefined in a makefile. This was not possible
  118.     in the original version. An other way to redefine the default rules is
  119.     to edit RULES.C and recompile and link. The values I have used in
  120.     RULES.C are relevant for my setup. (1 Mb 520 ST+, 2 double sided
  121.     floppies, no hard disk). You will probably want to edit them for
  122.     your setup.
  123.  
  124.     The default rules in RULES.C are as follows:
  125.  
  126.     .SUFFIXES: .prg .68k .o .bin .s .c .pas
  127.  
  128.     Alcyon C default rules (if MEGRULES is not defined):
  129.  
  130.     # Path to the Alcyon C executables
  131.     CPATH = a:\bin
  132.  
  133.     # C preprocessor
  134.     CP68 = "cp68.prg"
  135.  
  136.     # C preprocessor flags
  137.     CPFLAGS = -i a:\include\
  138.  
  139.     # Pass 1 of the C compiler
  140.     C068 = c068.prg
  141.     # Pass 1 flags 
  142.     C0FLAGS = -f   # change to "" if you want to use IEEE
  143.                    # floating point and libm instead of libf
  144.                    # by Default. Otherwise simply redefine
  145.                    # C0FLAGS in your makefile to get the
  146.                    # IEEE floating option.
  147.  
  148.     # Pass 2 of the C compiler
  149.     C168 = c168.prg
  150.  
  151.     # Pass 2  flags
  152.     C1FLAGS = # not defined
  153.  
  154.     # Assembler
  155.     AS = as68.prg
  156.     # Assembler flags
  157.     ASFLAGS = -l -u -s a:\
  158.  
  159.     .c.o:
  160.         $(CPATH)\$(CP68) $(CPFLAGS) $< $*.i
  161.         $(CPATH)\$(C068) $*.i $*.1 $*.2 $*.3 $(C0FLAGS)
  162.         $(RM) $*.i
  163.         $(CPATH)\$(C168) $*.1 $*.2 $*.s $(C1FLAGS)
  164.         $(RM) $*.1 $*.2
  165.         $(CPATH)\$(AS) $(ASFLAGS) $*.s
  166.         $(RM) $*.s
  167.  
  168.     .s.o:
  169.         $(CPATH)\$(AS) $(ASFLAGS) $<
  170.  
  171.     # Linker of choice
  172.     LINKER = a:\link68.prg
  173.  
  174.     # Relmod
  175.     RELMOD = a:\relmod.prg
  176.  
  177.  
  178.     Megamax C default rules (if MEGRULES is defined):
  179.  
  180.     # Megamax C Rules default
  181.  
  182.     # Path to the Megamax C executables */
  183.     CPATH = a:
  184.  
  185.     # C Compiler
  186.     MMCC = mmcc.ttp
  187.  
  188.     # Code Optimizer
  189.     MMIMP = mmimp.ttp
  190.  
  191.     .c.o:
  192.     $(CPATH)\$(MMCC) $<
  193.     $(CPATH)\$(MMIMP) $*.o
  194.  
  195.     # Linker of choice
  196.     LINKER = $(CPATH)\mmlink.ttp
  197.  
  198.     Jwahar did not define any default '.pas.bin' rule for OSS Pascal, but
  199.     that should be easy to add.
  200.  
  201.  
  202.     How to Compile Make:
  203.  
  204.     Edit the file H.H. If you want to use the Megamax C compiler
  205.     uncomment the line /* #define MEGAMAX */ to define the symbol 'MEGAMAX'.
  206.     You probably have to edit all the sources to define the symbol 'ATARIST'.
  207.     I do not know how to tell mmcc that a preprocessor symbol is defined.
  208.     If you are using the Alcyon C compiler, leave the line commented out.
  209.     Edit the file RULES.C and the symbol 'MEGRULES' in H.H for your taste.
  210.     If you have the Beckemeyer C shell you may use the shell scripts
  211.     compile.sh and link.sh for Alcyon C
  212.  
  213.     If you don't have the microCshell, then you will have to use these scripts
  214.     as guideline.
  215.  
  216.     Once make.prg is made, you can safely throw away all the shell scripts!!
  217.     If you intend to use make from the desktop, rename it to make.ttp.
  218.  
  219.  
  220.     This program is fully in the Public Domain, and you are encouraged
  221.     to distribute copies of the program. Your comments/criticisms/fixes etc.
  222.     will be